using System;

namespace Tort.Attributes
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public sealed class PrimeKeyAttribute : DBFieldAttribute
    {
        public PrimeKeyAttribute()
            : base()
        {
            primeKeyData = PrimeKeyGenerator.Database;
        }

        public PrimeKeyAttribute(string columnName)
            : base(columnName)
        {
            primeKeyData = PrimeKeyGenerator.Database;
        }

        public PrimeKeyAttribute(PrimeKeyGenerator generator, String columnName)
            : base(columnName)
        {
            primeKeyData = generator;
        }

        private PrimeKeyGenerator primeKeyData;

        public PrimeKeyGenerator Generator { get { return primeKeyData; } }
    }
}
